<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <style>
      input {
        width: 200px;
        height: 30px;
        padding: 3px 10px;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <input type="text" placeholder="请输入" @keyup.enter="show" /> <br /><br />
      <button class="btn btn-info" v-on:click="show">提交</button>
    </div>

    <script>
      // 创建根实例
      new Vue({
        el: "#app",
        data: {},
        methods: {
          show: function() {
            alert("提交");
          }
        }
      });
    </script>
  </body>
</html>
